//
//  WSLoginViewController.m
//  FamilyLinkPro
//
//  Created by 江鹏 on 2023/9/7.
//  Copyright © 2023 SiterWell.Co.,Ltd. All rights reserved.
//

#import "WSLoginViewController.h"

@interface WSLoginViewController ()

@end

@implementation WSLoginViewController


+ (WSLoginViewController *)showController:(UIViewController *)superViewController {
    WSLoginViewController *vc = [[WSLoginViewController alloc] init];
    [superViewController.navigationController pushViewController:vc animated:YES];
    return vc;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupSubviews];
}

// MARK: 添加子控件
- (void)setupSubviews {
    [self setupRightItemButton];
    WSLoginView *loginView = [[WSLoginView alloc] initWithFrame:CGRectZero];
    [self.view addSubview:loginView];
    [loginView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view).insets(UIEdgeInsetsZero);
    }];
    loginView.delegate = self;
}

- (void)setupRightItemButton {
    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setFrame:CGRectMake(0, 0, 40, 40)];
    [rightBtn setTitle:@"注册" forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(registerBtnClick) forControlEvents:UIControlEventTouchUpInside];
    rightBtn.titleLabel.font = fontBold(14);
    [rightBtn setTitleColor:UIColorFromRGB_0x(0x333333) forState:UIControlStateNormal];
    if (_ios11_0_){
        [rightBtn setFrame:CGRectMake(0, 0, 40, 40)];
       // rightBtn.contentEdgeInsets=UIEdgeInsetsMake(0, 0, 0, 10);
    }
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
    self.navigationItem.rightBarButtonItem = item;
    
}


// MARK: action

- (void)registerBtnClick {
    
}


// MARK: WSLoginViewDelegate

- (void)userProtocolClick {
    
}

- (void)privacyClick {
    
}

- (void)loginButtonClickWithAccount:(NSString *)account
                       withPassword:(NSString *)password {
    
    [WSDeviceHomeViewController showController:self];
    
}

- (void)forgetPasswordButtonClick {
    
}




@end
